<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script>
    /*药品厂商补全*/
    autoCompleteFirm("operationCode");
    function autoCompleteFirm(inputId){
        var url="${ctx}/operation/icd9ItemClass/autoComplete";
        autoComplete(inputId,url,
                function(data){
                    var rows = [];
                    for(var i=0; i<data.length; i++){
                        rows[rows.length] = {
                            data:data[i],
                            value:data[i].icdCode,
                            result:data[i].icdCode
                        };
                    }
                    return rows;
                },function(data, i, max){
                    return data.icdCode+"|"+data.icdName;
                },function(event,data,formatted){
                    $('#operationName').attr('value',data.icdName);
                });
    }
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li>
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationDict/index')">手术项目列表</a>
            </li>
            <li class="active">
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationDict/form')">
                    <c:choose>
                        <c:when test="${operationDict.id==''|| operationDict.id==null}">
                            手术项目添加
                        </c:when>
                        <c:otherwise>手术项目修改</c:otherwise>
                    </c:choose>
                </a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="col-lg-12">
                    <form:form id="inputForm" data-parsley-validate="" modelAttribute="operationDict"
                               onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/operation/operationDict/save','${ctx}/operation/operationDict/index');"
                               method="post" class="form-horizontal">
                        <form:hidden path="id"/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手术icd9编码：</label>

                            <div class="col-sm-4">
                                <form:input path="operationCode" htmlEscape="false" class="form-control"
                                            maxlength="20"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手术操作名称：</label>

                            <div class="col-sm-4">
                                <form:input path="operationName" htmlEscape="false" class="form-control"
                                            maxlength="50"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手术等级：</label>

                            <div class="col-sm-4">
                                <form:select path="operationScale" class="form-control" data-parsley-required="true">
                                    <form:option value="" label=""/>
                                    <form:options items="${fns:getDictList('OPERATION_SCALE')}" itemLabel="label"
                                                  itemValue="value" htmlEscape="false"/>
                                </form:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">价格：</label>

                            <div class="col-sm-4">
                                <form:input path="price" htmlEscape="false" class="form-control" maxlength="64"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">折扣价：</label>
                            <div class="col-sm-4">
                                <form:input path="preferPrice" htmlEscape="false" class="form-control" maxlength="64"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                                <input id="btnCancel" class="btn" type="button" value="返 回"
                                       onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationDict/index')">
                            </div>
                        </div>
                    </form:form>
                </div>

            </div>
        </section>
    </div>
</div>